<!--
 * @Description: display：table-cell 作为表格单元格元素，常用语垂直居中
 * @Author: dh
 * @Date: 2021-09-02 08:57:28
 * @LastEditors: dh
 * @LastEditTime: 2022-07-07 09:48:28
-->
<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>

	<body>
		<style>
			.parent {
				width: 30vw;
				height: 30vh;
				border: 3px solid steelblue;
				/* 核心代码 */
				display: table-cell;
				text-align: center;
				vertical-align: middle;
			}

			.child {
				background: tomato;
				/* 核心代码 */
				display: inline-block;
			}

			tr {
				height: 50px;
			}

			td {
				width: 100px;
			}
		</style>
		<div class="parent">
			<p class="child">尝试新的跨平台</p>
		</div>

		<table border="1" cellspacing="0" s>
			<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
			</tr>
			<tr>
				<td>1</td>
				<td>2</td>
				<td>3</td>
				<td>4</td>
			</tr>
		</table>
	</body>
</html>
